home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / startrek / trek73 / src / mission.c < prev    next >
C/C++ Source or Header  |  1995-04-11  |  4KB  |  132 lines

  1. /*
  2.  * TREK73: mission.c
  3.  *
  4.  * Mission Assignment
  5.  *
  6.  */
  7.  
  8. #include "structs.h"
  9. #include "defines.h"
  10.  
  11. extern int terse;
  12. extern char title[];
  13. extern char foerace[];
  14. extern char foename[];
  15. extern char foestype[];
  16. extern char captain[];
  17. extern char science[];
  18. extern char com[];
  19. extern char helmsman[];
  20. extern struct ship *shiplist[];
  21. extern int shipnum;
  22.  
  23. mission()
  24. {
  25.     int onef;
  26.     extern char *plural(), *vowelstr();
  27.  
  28.     if (terse)
  29.         return;
  30.     onef = (shipnum == 1);
  31.     printf("\n\n\nSpace, the final frontier.\n");
  32.     printf("These are the voyages of the starship %s.\n", shiplist[0]->name);
  33.     printf("Its five year mission: to explore strange new worlds,\n");
  34.     printf("to seek our new life and new civilizations,\n");
  35.     printf("to boldly go where no man has gone before!\n");
  36.     printf("\n");
  37.     printf("                    S T A R    T R E K\n");
  38.     printf("\n");
  39.     missionlog();
  40.     printf("%s: %s, I'm picking up %d vessel%s on interception\n", helmsman, title, shipnum, plural(shipnum));
  41.     printf("   course with the %s.\n", shiplist[0]->name);
  42.     printf("%s: Sensors identify %s as ", science, onef ? "it" : "them");
  43.     if (onef)
  44.         printf("a%s ", vowelstr(foerace));
  45.     printf("%s %s%s,\n", foerace, foestype, plural);
  46.     printf("   probably under the command of Captain %s.\n", foename);
  47.     printf("%s: Sound general quarters, Lieutenant!\n", captain);
  48.     printf("%s: Aye, %s!\n", com,  title);
  49. }
  50.  
  51. warning()
  52. {
  53.     register int i;
  54.  
  55.     printf("Computer: The %ss are attacking the %s with the ", foerace, shiplist[0]->name);
  56.     if (shipnum == 1) {
  57.         printf("%s", shiplist[1]->name);
  58.     } else {
  59.         for (i = 1; i <= shipnum; i++) {
  60.             if (i == shipnum)
  61.                 printf("and the ");
  62.             printf("%s", shiplist[i]->name);
  63.             if (i == shipnum)
  64.                 break;
  65.             printf(", ");
  66.             /*
  67.             if ((shipnum == 2 && i == 1) || i == 2 || i == 7)
  68.             */
  69.             if (i == 1 || i == 7)
  70.                 printf("\n   ");
  71.         }
  72.     }
  73.     printf(".\n");
  74. }
  75.  
  76. missionlog()
  77. {
  78.     static char *missiontab[] = {
  79.     "   We are acting in response to a Priority 1 distress call from",
  80.     "space station K7.",
  81.     "   We are orbiting Gamma 2 to make a routine check of automatic",
  82.     "communications and astrogation stations.",
  83.     "   We are on course for Epsilon Canares 3 to treat Commissioner",
  84.     "Headford for Sukaro's disease.",
  85.     "   We have been assigned to transport ambassadors to a diplomatic",
  86.     "conference on the planet code named Babel.",
  87.     "   Our mission is to investigate a find of tritanium on Beta 7.",
  88.     0,
  89.     "   We are orbiting Rigel 4 for therapeutic shore leave.",
  90.     0,
  91.     "   We are orbiting Sigma Iota 2 to study the effects of",
  92.     "contamination upon a devoloping culture.",
  93.     "   We have altered course for a resue mission on the Gamma 7A",
  94.     "system.",
  95.     "   We are presently on course for Altair 6 to attend inauguration",
  96.     "cermonies on the planet.",
  97.     "   We are on a cartographic mission to Polex 9.",
  98.     0,
  99.     "   We are headed for Malurian in response to a distress call",
  100.     "from that system.",
  101.     "   We are to negotiate a treaty to mine dilithium crystals from",
  102.     "the Halkans.",
  103.     "   We are to investigate strange sensor readings reported by a",
  104.     "scoutship investigating Gamma Triangula 6.",
  105.     "   We are headed for planets L370 and L374 to investigate the",
  106.     "disappearance of the starship Constellation in that vincinity.",
  107.     "   We are ordered, with a skeleton crew, to proceed to Space",
  108.     "Station K2 to test Dr. Richard Daystrom's computer M5.",
  109.     "   We have encountered debris from the SS Beagle and are",
  110.     "proceeding to investigate.",
  111.     "   We are on course for Ekos to locate John Gill.",
  112.     0,
  113.     "   We are to divert an asteroid from destroying an inhabited",
  114.     "planet.",
  115.     "   We are responding to a distresss call form the scientific",
  116.     "expedition on Triacus.",
  117.     "   We have been assigned to transport the Medusan Ambassador to",
  118.     "to his home planet."
  119.     };
  120.     int t1, t2;
  121.  
  122.     t2 = randm(100) - 1;
  123.     t1 = randm(100) - 1;
  124.     printf("%s:  Captain's log, stardate %d.%d.\n", captain, t1, t2);
  125.     t1 = (randm(20) - 1) * 2;
  126.     printf("%s\n", missiontab[t1]);
  127.     t1++;
  128.     if (!missiontab[t1])
  129.         return;
  130.     printf("   %s\n", missiontab[t1]);
  131. }
  132.